<?php
class DB_Connect{
	private $conexao;
		
	public function __construct($host, $user, $pass, $database){
		$this->conexao = mysql_connect($host,$user,$pass) or die(mysql_error());
		mysql_select_db($database,$this->conexao) or die(mysql_error());
	}
		
	public function Query($query){
		$result = mysql_query($query,$this->conexao);
		
		if(!$result){		
			return false;
		}
		return new DB_Result($result);
	}
	
	public function LastInsertId(){
		return mysql_insert_id($this->conexao);
	}
	
	public function AffectedRows(){
		return mysql_affected_rows();
	}
}
?>